package cn.bdqn.service.impl;

import cn.bdqn.mapper.ItripHotelOrderMapper;
import cn.bdqn.mapper.ItripOrderLinkUserMapper;
import cn.bdqn.service.ItripOrderService;
import cn.bdqn.vo.ItripPersonalOrderRoomVO;
import org.springframework.stereotype.Service;
import org.springframework.web.context.annotation.RequestScope;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ItripOrderServiceImpl implements ItripOrderService {

    @Resource
    private ItripHotelOrderMapper itripHotelOrderMapper;
@Resource
private ItripOrderLinkUserMapper itripOrderLinkUserMapper;
    @Override
    public ItripPersonalOrderRoomVO getpersonalorderroominfo(Long orderId) {
        return itripHotelOrderMapper.selectPersonalOrderRoomInfo(orderId);
    }

    @Override
    public List selectOrderLinkUserMessageByOrderId(Long orderId) {
        return itripOrderLinkUserMapper.selectLinkUser(orderId);
    }

    @Override
    public boolean flushOrderStatus(int type) {
        int temp=0;
        if(type==1){
           temp=itripHotelOrderMapper.flushCancelOrderStatus();
        }else{
            temp=itripHotelOrderMapper.flushSuccessOrder();
        }
        if(temp>0){
            return true;
        }
        return false;
    }


}
